This team exercise has three tasks:
This is a team-based activity for the Term Project with a suite of unit tests written. It is due on the same day as the Unit testing - individual exercise. Each team member should have generated tests for two classes and you can analyze the coverage that they provide.
You should meet as a team and let one member generate the reports which will take only a few minutes. Then spend in the range of 30 minutes discussing the results of the analysis and generating your analysis report.
Your team will be required to re-run the above in future submissions. See specific Sprint details and Design Document requirements.
You will start with
Generate the JaCoCo reports using the following Maven command: mvn clean test jacoco:report
The output should look something like this.
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.224 s - in com.heroes.api.heroesapi.HeroesApiApplicationTests [INFO] Running com.heroes.api.heroesapi.controller.HeroControllerTest 2021-11-28 15:18:36.463 INFO 38546 --- [ main] c.h.a.h.controller.HeroController : DELETE /heroes/99 2021-11-28 15:18:36.472 INFO 38546 --- [ main] c.h.a.h.controller.HeroController : GET /heroes/99 2021-11-28 15:18:36.475 INFO 38546 --- [ main] c.h.a.h.controller.HeroController : POST /heroes Hero [id=99, name=Chicken-Man] 2021-11-28 15:18:36.481 INFO 38546 --- [ main] c.h.a.h.controller.HeroController : PUT /heroes Hero [id=99, name=Hen-Woman] 2021-11-28 15:18:36.483 INFO 38546 --- [ main] c.h.a.h.controller.HeroController : GET /heroes/99 2021-11-28 15:18:36.484 INFO 38546 --- [ main] c.h.a.h.controller.HeroController : POST /heroes Hero [id=99, name=Chicken-Man] 2021-11-28 15:18:36.485 INFO 38546 --- [ main] c.h.a.h.controller.HeroController : GET /heroes/?name=an 2021-11-28 15:18:36.487 INFO 38546 --- [ main] c.h.a.h.controller.HeroController : DELETE /heroes/99 2021-11-28 15:18:36.488 INFO 38546 --- [ main] c.h.a.h.controller.HeroController : GET /heroes [INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.181 s - in com.heroes.api.heroesapi.controller.HeroControllerTest [INFO] Running com.heroes.api.heroesapi.persistence.HeroFileDAOTest 2021-11-28 15:18:37.024 ERROR 38546 --- [ main] c.h.a.heroesapi.persistence.HeroFileDAO : null [INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.532 s - in com.heroes.api.heroesapi.persistence.HeroFileDAOTest [INFO] Running com.heroes.api.heroesapi.model.HeroTest [INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.heroes.api.heroesapi.model.HeroTest [INFO] [INFO] Results: [INFO] [INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] [INFO] --- jacoco-maven-plugin:0.8.7:report (report) @ heroes-api --- [INFO] Loading execution data file /Users/mikez/work/ang/heroes-api/target/jacoco.exec [INFO] Analyzed bundle 'heroes-api' with 5 classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8.421 s [INFO] Finished at: 2021-11-28T15:18:37-05:00 [INFO] ------------------------------------------------------------------------
Use a browser to open the JaCoCo root analysis file. You will find these in the project's root directory at
/target/site/jacoco/index.html
.
Download the attached Code Coverage Analysis template file. Fill-in each section of the document following the directions in the template file. Spend in the range of 30 minutes on this portion of the activity.
Rename the analysis document to Team X - Code Coverage Analysis.docx
, where X
is the letter for your team. Submit the file to the Code coverage - team dropbox in Team Exercises area before the time specified in your section's schedule.